package com.tanhua.server.service;

import com.tanhua.autoconfig.template.HuanXinTemplate;
import com.tanhua.commons.constants.Constants;
import com.tanhua.model.vo.HuanXinUserVO;
import com.tanhua.server.interceptor.UserHolder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author Xiao
 * @version 1.0
 * @description 环信Service
 * @date 2021/10/30
 */
@Service
public class HuanXinService {
    @Autowired
    private HuanXinTemplate huanXinTemplate;

    /**
     * 环信-用户信息
     * @return
     */
    public HuanXinUserVO user() {
        Long userId = UserHolder.getUserId();
        String hxUser = Constants.HX_USER_PREFIX + userId;
        String hxPassword = Constants.INIT_PASSWORD;
        return new HuanXinUserVO(hxUser, hxPassword);
    }
}
